package com.amado.easyui2.service.impl;

import java.util.List;

import com.amado.easyui2.dao.CoachStaffDao;
import com.amado.easyui2.dao.impl.CoachStaffDaoImpl;
import com.amado.easyui2.domain.CoachCarEntity;
import com.amado.easyui2.domain.CoachStaffEntity;
import com.amado.easyui2.service.CoachStaffService;
import com.amado.easyui2.vo.Page;

public class CoachStaffServiceImpl implements CoachStaffService {
private CoachStaffDao coachStaffDao=new CoachStaffDaoImpl();
	@Override
	public void add(CoachStaffEntity cn) {
		coachStaffDao.add(cn);
	}

	@Override
	public List<CoachStaffEntity> list() {
		// TODO Auto-generated method stub
		return coachStaffDao.listAll();
	}

//	@Override
//	public void delete(List<Long> id) {
//		coachStaffDao.delete(id);
//		
//	}

	@Override
	public void update(CoachStaffEntity cn) {
		coachStaffDao.update(cn);
		
	}

	@Override
	public List<CoachStaffEntity> list(String cn, String cIC) {
		// TODO Auto-generated method stub
		return coachStaffDao.listAll(cn, cIC);
	}

	@Override
	public List<CoachStaffEntity> getCoach(CoachStaffEntity cIC) {
		// TODO Auto-generated method stub
		return coachStaffDao.login(cIC);
	}

	@Override
	public Page<CoachStaffEntity> listAll(String cn, String cIC, Page page) {
		int total = coachStaffDao.listAllCount(cn, cIC);
		Page<CoachStaffEntity> newPage  = new Page<>();
		newPage.setTotal(total);
		newPage.setRows(coachStaffDao.listAll(cn, cIC, page));
		return newPage;
	}

	@Override
	public void delete(List<Long> id) {
		coachStaffDao.delete(id);
		
	}
	
}
